package im.yisme.controler;

import im.yisme.model.service.ModelServiceProvider;
import im.yisme.model.service.MusicRepositoryService;
import im.yisme.vo.MusicVO;
import im.yisme.controler.service.MusicCtrlService;

public class MusicCtrl implements MusicCtrlService{

	private static MusicCtrl ctrl;
	private MusicRepositoryService service;
	
	private MusicCtrl(){
		service = ModelServiceProvider.getMusicRepositoryService();
	}
	
	public static MusicCtrl getInstance(){
		return ctrl == null ? ctrl = new MusicCtrl() : ctrl;
	}


	public long addMusicToRepository(MusicVO toAdd) {
		// TODO Auto-generated method stub
		return service.addMusicToRepository(toAdd);
	}


	public boolean removeMusicFromRepository(MusicVO toRemove) {
		// TODO Auto-generated method stub
		return service.removeMusicFromRepository(toRemove);
	}


	public boolean alterMusicInfo(MusicVO musicVO) {
		// TODO Auto-generated method stub
		return service.alterMusicInfo(musicVO);
	}
	
	public MusicVO findMusic(long musicId){
		return service.findMusic(musicId);
	}
}
